package com.zm.zmgz.pojo;

public class ShowEmployeesParamBean { // 搜索员工信息的参数(前端传入)

    private int displayMode; // 完整显示还是精简显示

    private int page; // 第几页

    private int limit; // 每页记录数

    private String searchOption; // 搜索选项

    private String searchOptionValue; // 搜索选项值

    private int limitA; // mysql limit 第一个参数;从0开始的记录下标

    private int limitB; // mysql limit 第二个参数;需要返回的记录数

    public void setlimitAAndlimitB(){ // 通过page和limit计算limitA和limitB的值

        setLimitA((getPage()-1)*getLimit());

        setLimitB(getLimit());
    }

    @Override
    public String toString() {
        return "ShowEmployeesParamBean{" +
                "displayMode=" + displayMode +
                ", page=" + page +
                ", limit=" + limit +
                ", searchOption='" + searchOption + '\'' +
                ", searchOptionValue='" + searchOptionValue + '\'' +
                ", limitA=" + limitA +
                ", limitB=" + limitB +
                '}';
    }

    public int getDisplayMode() {
        return displayMode;
    }

    public void setDisplayMode(int displayMode) {
        this.displayMode = displayMode;
    }

    public int getPage() {
        return page;
    }

    public void setPage(int page) {
        this.page = page;
    }

    public int getLimit() {
        return limit;
    }

    public void setLimit(int limit) {
        this.limit = limit;
    }

    public String getSearchOption() {
        return searchOption;
    }

    public void setSearchOption(String searchOption) {
        this.searchOption = searchOption;
    }

    public String getSearchOptionValue() {
        return searchOptionValue;
    }

    public void setSearchOptionValue(String searchOptionValue) {
        this.searchOptionValue = searchOptionValue;
    }

    public int getLimitA() {
        return limitA;
    }

    public void setLimitA(int limitA) {
        this.limitA = limitA;
    }

    public int getLimitB() {
        return limitB;
    }

    public void setLimitB(int limitB) {
        this.limitB = limitB;
    }

    public ShowEmployeesParamBean() {
    }

    public ShowEmployeesParamBean(int displayMode, int page, int limit, String searchOption, String searchOptionValue) {
        this.displayMode = displayMode;
        this.page = page;
        this.limit = limit;
        this.searchOption = searchOption;
        this.searchOptionValue = searchOptionValue;
    }
}
